home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
dgarbage.zip
/
DGARBAGE.DOC
next >
Wrap
Text File
|
1988-05-09
|
16KB
|
358 lines
DGARBAGE VERSION 1.1
--------------------
DISCLAIMER
----------
This program is provided as is and I accept no responsibility
for any loss or damage of any files or data that may be
caused by using this program. I have performed fairly
extensive testing of the program, but it is not possible for
me to exhaustively test every potential situation. If the
data in the file you wish to process is important to you then
make a copy of the file and process that. I have never had
any problems with the input file during my testing, but
anything is possible.
Once again, I AM NOT RESPONSIBLE IN ANY WAY FOR ANYTHING.
(Or as my mother always says, I am totally irresponsible).
INTRODUCTION
------------
This utility program removes all non - printable characters
from an ASCII text file and restricts the line length to a
specified maximum number of characters. It was designed to
remove the "line noise" characters from capture files made by
a communications program on line to a bulletin board.
The text is read from a file specified on the command line
and the resulting text after processing is output to a second
file, the name of which is also specified on the command
line. The original file is left untouched which allows
multiple processing with different options set until the
desired result is achieved.
All characters with an ASCII value less than 32, excepting
ASCII 10 (Line Feed) and ASCII 13 (Carriage Return) are
removed from the text. By default, all characters with an
ASCII value of greater than 127 are also removed, although
this can be changed by command line options so that either
the character is converted to a seven bit character by
stripping the eighth bit, or is left entirely unchanged.
USAGE
-----
The syntax for the command is:-
DGARBAGE infile outfile (options)
Infile and outfile MUST be specified - they are,
respectively, the file containing the raw text to be
processed and the file that will hold the text after
processing.
Infile must exist and must either be present in the current
directory or must have an appropriate path prefixed to it's
name; e.g.:-
DGARBAGE file1 file2
(if the file is in the current directory)
DGARBAGE \dir1\dir2\file1 file2
(if the file is in the directory \dir1\dir2).
Outfile need not exist and will be created if necessary. If
it DOES exist you will be prompted as to whether or not you
wish to overwrite it. For example if "file2" already exists
and you enter the following command (in the root directory):-
DGARBAGE file1 file2
then the following prompt will be displayed:-
File C:\FILE2 Already Exists
Overwrite it (Y/N) ?
If you then press Y, the file will be over written and it's
current contents will be lost. However, if you press N then
the program will terminate.
If less than two parameters are specified after DGARBAGE, or
if the same file name is given for infile and outfile, the
program will display it's help screen and terminate. If
infile does not exist, or if outfile can not be opened (e.g.
if it is set to READ ONLY), then an appropriate error message
will be displayed and the program will terminate.
OPTIONS
-------
The options listed below may be entered in any order,
separated by a space. They may be entered in upper or lower
case. Note the comments for each option on the restrictions
(if any) in using that option with other options.
B Use BIOS screen writing method.
The default is to use direct screen memory writing,
however, this method doesn't work on all types of video
adapter. If you have problems with the display, then
use the B option.
D Display the text on the screen as it is processed.
The default is that the text is not displayed as it is
processed, just an information box at the top of the
screen which shows the progress of the processing. This
is the fastest method, allowing approximately 9000
characters to be processed per second. However, because
the program uses very large buffers (30k for infile and
31k for outfile) a seemingly long time can pass between
updates to the information box, which only take place
as each 30k block of text is read from disk. Therefore
the D option has been included for those people who
like to be sure that something is happening.
The effect of the D option depends on whether or not
the B option is also specified. If the B option is not
specified then the text is displayed in a window at the
bottom of the screen using the fast screen write
method. This slows the processing speed down to
approximately 1200 characters per second. If the B
option is specified in addition to the D option then
the text is displayed using the entire screen (the
information box is not displayed) and the processing
speed slows down to approximately 300 characters per
second.
K/S The K and S options control what action the program
takes when it encounters a character with the 8th bit
set - i.e. a character with an ASCII value greater than
127. By default, these characters are removed from the
text stream entirely and do not appear in outfile. This
was done because most "line noise" characters appear to
be in this range. However, these characters are also
the IBM graphics characters, so there may be some
occasions when it is not desirable to remove them.
The K option tells the program to pass these characters
through unchanged (Keep them) so they will appear in
Outfile exactly as they appeared in infile.
The S option tells the program to strip the 8th bit
from these characters converting them to a character in
the range 0-127. For example, the IBM horizontal double
line character (═) which has an ASCII value of 205 will
be converted to a character with an ASCII value of 78
which is the letter M.
These options only control what processing (if any) is
performed on characters with an ASCII value greater
than 127. Characters with an ASCII value less than 32
(excluding CR/LF) are ALWAYS removed from the text
stream.
Note that the K and S options are mutuall